package com.sephiron.clocksynchronizer;

import java.util.ArrayList;
import java.util.UUID;
import android.support.v4.app.Fragment;

public class TimeSyncEditModeActivity extends SingleFragmentActivity {

	private boolean editable;
	private UUID cctvId;

	private ArrayList<Cctv> mCctvs = CctvLab.get(this).getCctvs();

	@Override
	protected Fragment createFragment() {
		editable = getIntent().getBooleanExtra(TimeSyncFragment.EXTRA_EDIT_MODE, false);
		cctvId = (UUID)getIntent().getSerializableExtra(TimeSyncFragment.EXTRA_CCTV_ID);
		for (int i = 0; i < mCctvs.size(); i++) {
			if (mCctvs.get(i).getId().equals(cctvId)) {
				if (mCctvs.get(i).getCctvName() != null) {
					setTitle(mCctvs.get(i).getCctvName());
				}
				break;
			}
		}
		
		return TimeSyncFragment.newInstance(cctvId, editable);
	}

}
